<div>
	<el-dialog title="附件" :visible.sync="dialogVisible" append-to-body @close="save">
		<el-card>
			<el-tabs v-model="activeName">
				<el-tab-pane v-if="uploadTab" label="上传附件" name="first">
					<div>
						<el-button v-if="!disabled" type="primary" @click="upload" :loading="loading">上传附件</el-button>
					</div>
					<vxe-grid :columns="columns" :data="filedata" align="center">
						<template #operate="{row,rowIndex}">
							<el-button type="text" @click="preview(row)">预览</el-button>
							<el-button type="text" @click="download(row)">下载</el-button>
							<el-button v-if="!disabled" type="text" @click="deleteRow(row,rowIndex,filedata,true)">删除</el-button>
						</template>
					</vxe-grid>
				</el-tab-pane>
				<el-tab-pane v-if="relationTab" label="关联附件" name="second">
					<div>
						<el-button v-if="!disabled" type="primary" @click="openSelectFile">关联附件</el-button>
					</div>
					<vxe-grid :columns="columns" :data="relationdata" align="center">
						<template #operate="{row,rowIndex}">
							<el-button type="text" @click="preview(row)">预览</el-button>
							<el-button type="text" @click="download(row)">下载</el-button>
							<el-button v-if="!disabled" type="text" @click="deleteRow(row,rowIndex,relationdata)">删除</el-button>
						</template>
					</vxe-grid>
				</el-tab-pane>
			</el-tabs>
		</el-card>
		<select-file ref="selectFile" @save="saveFile"></select-file>
		<span slot="footer" class="dialog-footer">
			<el-button type="primary" @click="save">确 定</el-button>
		</span>
	</el-dialog>
</div>